package com.sms.platform;

import com.sms.platform.common.constants.RabbitMqConsants;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.amqp.core.Queue;

/**
 * @author xjh
 * @date 2020-08-11
 */
@Configuration
public class RabbitConfig {

    @Bean
    public Queue queue(){
        return new Queue(RabbitMqConsants.TOPIC_PRE_SEND);
    }
    @Bean
    public Queue queue1(){
        return new Queue(RabbitMqConsants.TOPIC_PUSH_SMS_REPORT);
    }
    @Bean
    public Queue queue2(){
        return new Queue(RabbitMqConsants.TOPIC_BAD_REPORT);
    }

    @Bean
    public MessageConverter messageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}